﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Windows.Forms;

namespace Typheus
{
    public partial class Settings : Form
    {
        private WebBrowser web;
        public Settings(WebBrowser web)
        {
            InitializeComponent();
            this.web = web;
            chkDebug.Checked = ReadXML.GetDebugMode();
            txtHomePage.Text = ReadXML.GetHomepage();
            //txtDownload.Text = ReadXML.GetDownloadDir();
        }

        private void btnUpdateHomePage_Click(object sender, EventArgs e)
        {
           ReadXML.SetHomePage(txtHomePage.Text);
        }

        private void btnUpdateDownload_Click(object sender, EventArgs e)
        {
            //ReadXML.SetDownloadDir(txtDownload.Text);
        }

        private void chkDebug_CheckedChanged(object sender, EventArgs e)
        {

            ReadXML.SetDebugMode(chkDebug.Checked);
            if (chkDebug.Checked)
            {
                web.ScriptErrorsSuppressed = false;
            }
            else if (!chkDebug.Checked)
            {
                web.ScriptErrorsSuppressed = true;
            }
        }

        private void btnAbout_Click(object sender, EventArgs e)
        {
            MessageBox.Show(
                "This poorly design app was written by Zombie Chan on his spare time.\n\nThe art was stolen from Andrew Hussie at MSPaintAdventures.com",
                "About");
        }
    }
}
